package de.herberlin.server.common.event;

import de.herberlin.server.mail.MailHeader;


public class MailRequestEvent extends RequestEvent {

	private FileData conversation=null;
	private String to=null;
	private MailHeader from=null;

	public MailRequestEvent() {
		super();
	}


	public void setConversation(String history) {
		conversation=new FileData();
		conversation.setContentDescription("Conversation");
		conversation.setContentLength(history.length());
		conversation.setContentType("text/plain");
		conversation.setData(history.getBytes());
	}
	public Object getValueAt(int tableColumn) {
		switch (tableColumn) {
		case 0 :
			return getFormattedTimestamp();
		case 1 :
			return from;
		case 2 :
			return to;
		case 3 :
			return conversation;
		default :
			return "";
	}
	}


	public void setFrom(MailHeader from) {
		this.from = from;
	}


	public void setTo(String to) {
		this.to = to;
	}

}
